<template>
    <div>
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="用户名">
          <el-input v-model="form.userName"></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input v-model="form.password"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">立即创建</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>

  import axios from 'axios'

    export default {
        name: "",
      data(){
          return{
            form:{}
          }
      },
      methods:{
        onSubmit:function () {
          axios.post("http://121.36.161.39:8889/springboot/user/login",this.form).then(res=>{
            if (res.data.code==200){
            this.$router.push("/shop");
            } else{
              alert(res.data.message)
            }
          })
        }
      }
    }
</script>

<style scoped>

</style>
